/*
 * Copyright 2008-2010 GP Software
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *
 * ValidatorException.java | Created on July 6, 2010
 */
package com.pacm.i18n.validator;

/**
 * The validator exception wrapper
 *
 * @author Paul Augustine C. Mendoza
 * @since 1.1
 */
public class ValidatorException extends Exception {

    /**
     * The validator class
     */
    private Validator validator;

    /**
     * The constructor with validator reference
     *
     * @param validator
     */
    public ValidatorException(Validator validator) {
        super();
        this.validator = validator;
    }

    /**
     * The constructor with message and validator reference
     *
     * @param message   the exception message
     * @param validator the validator reference
     */
    public ValidatorException(String message, Validator validator) {
        super(message);
        this.validator = validator;
    }

    /**
     * The constructor with message, cause and validator reference
     *
     * @param message   the exception message
     * @param cause     the cause
     * @param validator the validator reference
     */
    public ValidatorException(String message, Throwable cause,
                              Validator validator) {
        super(message, cause);
        this.validator = validator;
    }

    /**
     * The constructor with cause and validator reference
     *
     * @param cause     the cause
     * @param validator the validator reference
     */
    public ValidatorException(Throwable cause, Validator validator) {
        super(cause);
        this.validator = validator;
    }

    /**
     * Returns the validator reference
     *
     * @return the validator
     */
    public Validator getValidator() {
        return this.validator;
    }

}
